﻿using System;

class SumOfFibonacciSequence
{
    static void Main()
    {
        //Write a program that reads a number N and calculates the sum of the
        //first N members of the sequence of Fibonacci: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, …

        Console.Write("N = ");
        int n = int.Parse(Console.ReadLine());

        double first = 0;
        double second = 1;
        double sum = 0;
        for (int i = 0; i < n; i++)
        {
            double number = first; 
            first = second;
            second += number;
            sum += number;           
        }
        Console.WriteLine("The sum of the first " + n + " members of Fibonacci sequence is: " + sum);
    }
}
